package com.fozu.office.sale.service;
/*
 * 销售计划
 */
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fozu.office.sale.dao.PlanDao;
import com.fozu.office.sale.entity.PlanVO;
@Service("planSve")
@Transactional(readOnly=true)
public class PlanServiceImpl {
	@Autowired
	private PlanDao pdao;
	//计划列表(分页)
	public IPage<PlanVO> listPlan(Page<PlanVO> age,PlanVO plan ){
		return pdao.listPlan(age,plan);
	}
	//删除操作
	@Transactional(readOnly=false)
	public void delPlans(String ids[]){
		PlanVO plan =new PlanVO();
		for (String id : ids) {
			plan.setId(id);
			pdao.delPlans(plan);
		}
	}
	//根据id拿对象
	public PlanVO getPlanById(PlanVO plan){
		return pdao.getPlanById(plan);
	}
	//修改
	@Transactional(readOnly=false)
	public void updatePlan(PlanVO plan){
		pdao.updatePlan(plan);
	}
	//添加
	@Transactional(readOnly=false)
	public void addPlan(PlanVO plan){
		pdao.addPlan(plan);
	}
	//修改status
	@Transactional(readOnly=false)
	public void updateStatus(PlanVO plan){
		pdao.updateStatus(plan);
	}
}
